package com.example.light.web.system.dao;

import com.example.light.web.system.entity.UserRole;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserRoleMapper {
    int deleteByPrimaryKey(Integer userRoleId);

    int insert(UserRole record);

    int insertSelective(UserRole record);

    UserRole selectByPrimaryKey(Integer userRoleId);

    int updateByPrimaryKeySelective(UserRole record);

    int updateByPrimaryKey(UserRole record);

    UserRole selectUserRole(Integer userId);

    @Update("update user_role set role_id=#{roleId}" +
            " where use_id=#{useId}")
    int updateByUserId(UserRole record);

    @Delete("delete from user_role where use_id=#{userId}")
    int deleteByUserId(Integer userId);
}